/*
 * LedAnimator_prv.h
 * @brief	
 * 
 * @deatils
 *
 * @Module_Owner Irbor	
 *
 * Copyright 2014 Bober Company
 *  
 */
#ifndef LEDANIMATOR_PRV_H_
#define LEDANIMATOR_PRV_H_
	
static const Led_TypeDef CIRCLE_LEDS[] = {LED3, LED5, LED7, LED9, LED10, LED8, LED6, LED4};
static const Led_TypeDef FIRST_HALF[] = {LED3, LED5, LED7, LED9};
static const Led_TypeDef SEC_HALF[] = {LED10, LED8, LED6, LED4};

#define Led_Groups \
					CIRCLE_LEDS,\
					FIRST_HALF,\
					SEC_HALF
	
typedef enum
{
	IDLE,
	RUNNING,
	LAST_STEP,
	FINISHED
}ANIMATION_STATE_TYPE;

typedef enum
{
	CONTINUE,
	REPEAT,
	STOP
}ANIMATION_EVENT_TYPE;

typedef struct
{
	unsigned int time;
	unsigned char mask;
	ANIMATION_EVENT_TYPE event;
	unsigned char param;
}ANIMATION_STEP_TYPE;

ANIMATION_STEP_TYPE Animation1[] =	{
		{ 3000, 0x01, CONTINUE, 0},
		{ 3000, 0x02, CONTINUE, 0},
		{ 3000, 0x04, CONTINUE, 0},
		{ 3000, 0x08, CONTINUE, 0},
		{ 3000, 0x10, CONTINUE, 0},
		{ 3000, 0x20, CONTINUE, 0},
		{ 3000, 0x40, CONTINUE, 0},
		{ 3000, 0x80, CONTINUE, 0},
		{ 3000, 0x00, STOP, 0}
};
ANIMATION_STEP_TYPE Animation2[] =	{
		{ 3000, 0x80, CONTINUE, 0},
		{ 3000, 0x40, CONTINUE, 0},
		{ 3000, 0x20, CONTINUE, 0},
		{ 3000, 0x10, CONTINUE, 0},
		{ 3000, 0x08, CONTINUE, 0},
		{ 3000, 0x04, CONTINUE, 0},
		{ 3000, 0x02, CONTINUE, 0},
		{ 3000, 0x01, CONTINUE, 0},
		{ 3000, 0x00, STOP, 0}
};

ANIMATION_STEP_TYPE Animation3[] =	{
		{ 3000, 0x01, CONTINUE, 0},
		{ 3000, 0x82, CONTINUE, 0},
		{ 3000, 0x44, CONTINUE, 0},
		{ 3000, 0x28, CONTINUE, 0},
		{ 3000, 0x10, CONTINUE, 0},
		{ 3000, 0x28, CONTINUE, 0},
		{ 3000, 0x44, CONTINUE, 0},
		{ 3000, 0x82, CONTINUE, 0},
		{ 3000, 0x01, REPEAT, 6}
};

ANIMATION_STEP_TYPE Animation4[] =	{
		{ 1000, 0x01, CONTINUE, 0},
		{ 1000, 0x03, CONTINUE, 0},
		{ 1000, 0x07, CONTINUE, 0},
		{ 1000, 0x0F, CONTINUE, 0},
		{ 1000, 0x1F, CONTINUE, 0},
		{ 1000, 0x3F, CONTINUE, 0},
		{ 1000, 0x7F, CONTINUE, 0},
		{ 1000, 0xFF, CONTINUE, 0},
		{ 2, 0x01, STOP, 0}
};

ANIMATION_STEP_TYPE Animation5[] =	{
		{ 1000, 0xE1, CONTINUE, 0},
		{ 1000, 0xC3, CONTINUE, 0},
		{ 1000, 0x87, CONTINUE, 0},
		{ 1000, 0x0F, CONTINUE, 0},
		{ 1000, 0x1E, CONTINUE, 0},
		{ 1000, 0x3C, CONTINUE, 0},
		{ 1000, 0x78, CONTINUE, 0},
		{ 1000, 0xF0, CONTINUE, 0},
		{ 1, 0x00, REPEAT, 20}
};

#define NUM_OF_ANIMATIONS 1

#define NUM_OF_CIRCLE_LEDS 8

ANIMATION_STEP_TYPE* Animations[NUM_OF_ANIMATIONS] = {Animation5};//, Animation2, Animation3, Animation4};

#endif /* LEDANIMATOR_PRV_H_ */
